﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EnvDTE;

namespace PS_WSSDeploy_Package.Application
{
    public enum WdProjectItemType
    {
        File = 0,
        Folder,
        Unknown
    }

    public class WdProjectItem
    {
        public string FullPath { get; set; }

        public WdProjectItemType Type { get; set; }

        public WdProjectItem(ProjectItem item)
        {
            FullPath = item.get_FileNames(0);
            Type = EnvDTEConstants2Type(item.Kind);
        }

        private static WdProjectItemType EnvDTEConstants2Type(string kind)
        {
            if (kind.Equals(Constants.vsProjectItemKindPhysicalFile))
            {
                return WdProjectItemType.File; 
            }
            if (kind.Equals(Constants.vsProjectItemKindPhysicalFolder))
            {
                return WdProjectItemType.Folder;
            }
            return WdProjectItemType.Unknown;
        }
    }
}
